using System.Threading.Tasks;
using YWM.Dto;

namespace YWM.Application
{
    public interface IAsyncCrudService<TEntityDto>
        : IAsyncCrudService<TEntityDto, long>
        where TEntityDto : IEntityDto<long>
    {

    }

    public interface IAsyncCrudService<TEntityDto, TKey>
        : IAsyncCrudService<TEntityDto, TKey, PagedAndSortedResultRequestDto>
        where TEntityDto : IEntityDto<TKey>
    {

    }

    public interface IAsyncCrudService<TEntityDto, TKey, in TGetAllInput>
        : IAsyncCrudService<TEntityDto, TKey, TGetAllInput, TEntityDto, TEntityDto>
        where TEntityDto : IEntityDto<TKey>
    {

    }

    public interface IAsyncCrudService<TEntityDto, TKey, in TGetAllInput, in TCreateInput>
        : IAsyncCrudService<TEntityDto, TKey, TGetAllInput, TCreateInput, TCreateInput>
        where TEntityDto : IEntityDto<TKey>
        where TCreateInput : IEntityDto<TKey>
    {

    }

    public interface IAsyncCrudService<TEntityDto, TKey, in TGetAllInput, in TCreateInput, in TUpdateInput>
        : IAsyncCrudService<TEntityDto, TKey, TGetAllInput, TCreateInput, TUpdateInput, EntityDto<TKey>>
        where TEntityDto : IEntityDto<TKey>
        where TUpdateInput : IEntityDto<TKey>
    {

    }

    public interface IAsyncCrudService<TEntityDto, TKey, in TGetAllInput, in TCreateInput, in TUpdateInput, in TGetInput>
        : IAsyncCrudService<TEntityDto, TKey, TGetAllInput, TCreateInput, TUpdateInput, TGetInput, EntityDto<TKey>>
        where TEntityDto : IEntityDto<TKey>
        where TUpdateInput : IEntityDto<TKey>
        where TGetInput : IEntityDto<TKey>
    {

    }

    public interface IAsyncCrudService<TEntityDto, TKey, in TGetAllInput, in TCreateInput, in TUpdateInput, in TGetInput, in TDeleteInput> : IAppService
        where TEntityDto : IEntityDto<TKey>
        where TUpdateInput : IEntityDto<TKey>
        where TGetInput : IEntityDto<TKey>
        where TDeleteInput : IEntityDto<TKey>
    {
        Task<TEntityDto> Get(TGetInput input);

        Task<PagedResultDto<TEntityDto>> GetAll(TGetAllInput input);

        Task<TEntityDto> Create(TCreateInput input);

        Task<TEntityDto> Update(TUpdateInput input);

        Task Delete(TDeleteInput input);
    }
}
